import java.util.Objects;

/**
 * @Author YuanYuan
 * @Date 2022/5/19
 * @Time 19:36
 */
public class Person {
    private String id;
    private int age;

    @Override
    public boolean equals(Object o) {
        //return this.age == ((Person) o).age;
        if(o == null) {
            return false;
        }
        if(o == this) {
            return true;
        }
        if(!(o instanceof Person)) {
            return false;
        }
        return this.id.equals(((Person) o).id);
    }


    @Override
    public int hashCode() {
        return Objects.hash(id);
    }

    public Person(String id, int age) {
        this.id = id;
        this.age = age;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
